package com.example.easy.mapper;

import com.example.easy.Dto.FoodSafety;
import com.example.easy.Dto.HealthSecurity;
import com.example.easy.Dto.Notice;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface HealthSecurityMapper {

    @Insert("Insert into health_security (number,title,content,time)Values(#{number},#{title},#{content},#{time})")
    int insHealthSecurity(HealthSecurity healthSecurity);//插入

    @Update("UPDATE health_security  SET title=#{title},content=#{content},time=#{time} WHERE number=#{number}")
    int updateHealthSecurity(HealthSecurity healthSecurity);//修改

    @Delete("DELETE FROM health_security WHERE  number=#{number}")
    int deleteHealthSecurity(int number);//删除

    @Select("SELECT * FROM health_security  WHERE number=#{number} ")
    HealthSecurity selectHealthSecurity(int number);//查看文章所有信息

    @Select("SELECT * FROM health_security ")
    List<HealthSecurity> selectall();//查看所有文章

}
